Dynomotion

Group: DynoMotion Message: 14871 From: andysontag Date: 6/8/2017
Subject: Geo Correction

I'm having a little trouble wrapping my head around how to implement Geo Correction within Kmotion. Our machine table isn't exactly square and I'd like to correct the motion so that when I tell the machine to make a square, it makes a square instead of a slight parallelogram. 


Could anyone explain what each line of the Geo Correction File is suppose to do? The example I've seen is as follows:


2, 2 (I'm assuming this means the grid/table will have 4 points)

1, 1 (X length in inches?, Y length? in inches?) (In other words this is the theoretical square/rectangle you will be transforming?)

-.5, -.5 (From what I've read this might be orienting the theoretical square around an origin. Not sure why one would need to do this)

0, 0, -1, 0, 0 (The first "0, 0" is indicating the theoretical point to be transformed is X0, Y0?)(The "-1, 0" is indicating the X0, Y0 should now be moved to X-1, Y0?)(The last "0" is the Z position)

0, 1, 0, -1, 0

1, 0, 0, 1, 0

1, 1, 1, 0, 0


The following is my first stab at making a geo correction file. I have a table that is 96" in X and 48" in Y which I'm assuming has straight lengths for X and Y and just needs to be squared a small amount.


2, 2

96, 48

0, 0

0, 0, 0, 0, 0

0, 1, -.5, 48.5, 0

1, 0, 96, 0, 0

1, 1, 95.5, 48.5, 0


The numbers I chose are just examples for helping me understand how to use the file. Once I do I'll be able to guess and check my way to square, at least I think I will.


Do my numbers seem like they would do what I'm hoping they will?


Andy


Group: DynoMotion Message: 14872 From: Tom Kerekes Date: 6/8/2017
Subject: Re: Geo Correction

Hi Andy,

See below:

On 6/8/2017 4:10 PM, andysontag@... [DynoMotion] wrote:
 

I'm having a little trouble wrapping my head around how to implement Geo Correction within Kmotion. Our machine table isn't exactly square and I'd like to correct the motion so that when I tell the machine to make a square, it makes a square instead of a slight parallelogram. 


Could anyone explain what each line of the Geo Correction File is suppose to do? The example I've seen is as follows:


2, 2 (I'm assuming this means the grid/table will have 4 points)

>>> Yes 2 rows and 2 cols

1, 1 (X length in inches?, Y length? in inches?) (In other words this is the theoretical square/rectangle you will be transforming?)

>>> Yes, or more correctly the grid spacing between the points in x and y in inches

-.5, -.5 (From what I've read this might be orienting the theoretical square around an origin. Not sure why one would need to do this)

>>> Yes.  Imagine you have an 11 rows x 11 cols with grid space 1 inch x 1 inch.  This will define a 10 inch x 10 inch array area.  But now where should this area be placed in the infinite xy plane?  We want the geocorrection table to cover the 10x10 inch area that the machine will use.  By default (offset 0,0) the xy origin will be at the lower left corner of the table.  In other words for x values between 0 and 1 and Y values between 0 and 1 the lower left 1 inch square grid area will apply to control the transformation.  However some machines might home in the center of travel such that 0,0 is in the center of travel and useful machine coordinates might be from -5 inches to +5 inches.  In this case we would want to offset the coordinates so that coordinates -5 to -4 inches correspond to the left most Grids so an offset of 5 inches would be specified.  below is the formula used to determine which grid will be used for the transformation.  The row, col is the lower left point of the grid area.  Add +1 to the row and/or col to get the other 3 points that define the area.

    int col = (int)floor((x-GeoOffsetX)/GeoSpacingX);
    int row = (int)floor((y-GeoOffsetY)/GeoSpacingY);

BTW outside of the geocorected table area the closest points are extrapolated out to infinity.  So actually with single square grid (2 rows and 2 cols) that grid expands (interpolates/extrapolates) to cover the infinite plane.


0, 0, -1, 0, 0 (The first "0, 0" is indicating the theoretical point to be transformed is X0, Y0?)

>>> no it indicates row 0, col 0 (lower left point in the Array) Note rows increase in the Y direction and cols in X

(The "-1, 0" is indicating the X0, Y0 should now be moved to X-1, Y0?)

>>> This means the row 0 col 0 point of the array (may or may not be X0 Y0 depending on how the array is positioned in the plane should now correspond to X-1 Y0.  The example you are using might be a bit extreme and confusing as it was created to show a major (45 degree) rotation and scaling transformation

(The last "0" is the Z position)

>>> correct

0, 1, 0, -1, 0

1, 0, 0, 1, 0

1, 1, 1, 0, 0


The following is my first stab at making a geo correction file. I have a table that is 96" in X and 48" in Y which I'm assuming has straight lengths for X and Y and just needs to be squared a small amount.


2, 2

96, 48

0, 0

>>> this assumes your machine origin is at the lower left of travel

0, 0, 0, 0, 0

>>> row 0 col 0 point will have no correction

0, 1, -.5, 48.5, 0

>>> No.  Row0 Col1 would be a shift in X (not Y) to the lower right of your machine travel. 

1, 0, 96, 0, 0

>>> No.  Row1 Col0 would be a shift in Y to the Upper Left of your machine travel.

1, 1, 95.5, 48.5, 0


>>> Possibly.  Row1 Col1 would be a shift in X and Y to the Upper Right of your machine travel.
HTH
Regards
TK

The numbers I chose are just examples for helping me understand how to use the file. Once I do I'll be able to guess and check my way to square, at least I think I will.


Do my numbers seem like they would do what I'm hoping they will?


Andy



Group: DynoMotion Message: 14877 From: andysontag Date: 6/9/2017
Subject: Re: Geo Correction
Hi Tom,

Thank you for the explanation. I was able to square my travel with the following geo correction file.

2,2
96,48
0,0
0,0,0,0,0
0,1,96,0,0
1,0,.026,48,0
1,1,96.026,48,0

I was surprised it worked on the first try. Now when I run gcode to create a very large rectangle, the diagonals both measure the same. In the past we adjusted the machine to square by changing the offset position of one of the x axis motors. While this strategy allowed us to create rectangles with the correct dimensions, it twisted the gantry in the process so that the cutter angle and position would be all over the place depending on where you were positioned in Y. The geo correction file seems to be a much better solution. 

Thanks again,
Andy
Group: DynoMotion Message: 14878 From: Tom Kerekes Date: 6/9/2017
Subject: Re: Geo Correction

Hi Andy,

Thanks for taking the time to post back.

We should probably make a Wizard to create a Geocorrection Table that would work for simple cases like this.

BTW I forgot to mention there is a "Measure" button on KMotionCNC Screen that can be used to help build the file.  If you create a skeleton file (Measurements.txt) with just your first 3 lines to define the theoretical 4 point array, then Jog to where the tool is at the correctly measured position for each of the 4 points and push "Measure" at each point the Geocorrection file should be created automatically.

Regards,

TK


On 6/9/2017 2:47 PM, andysontag@... [DynoMotion] wrote:
 

Hi Tom,


Thank you for the explanation. I was able to square my travel with the following geo correction file.

2,2
96,48
0,0
0,0,0,0,0
0,1,96,0,0
1,0,.026,48,0
1,1,96.026,48,0

I was surprised it worked on the first try. Now when I run gcode to create a very large rectangle, the diagonals both measure the same. In the past we adjusted the machine to square by changing the offset position of one of the x axis motors. While this strategy allowed us to create rectangles with the correct dimensions, it twisted the gantry in the process so that the cutter angle and position would be all over the place depending on where you were positioned in Y. The geo correction file seems to be a much better solution. 

Thanks again,
Andy